package com.chenjt.jvm.third.mat;

import java.util.ArrayList;
import java.util.Random;

/**
 * 注释：
 *
 * -Xms600m -Xmx600m -XX:SurvivorRatio=8
 *
 * @author chenjt
 * @date 2025/7/8 11:30
 */
public class OOMTest {

    public static void main(String[] args) {
        ArrayList<Picture> list = new ArrayList<>();

        while(true){

            try {
                Thread.sleep(5);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

            list.add(new Picture(new Random().nextInt(100 * 50)));
        }

    }


}

class Picture {
    private byte[] pixels;

    public Picture(int length){
        this.pixels = new byte[length];
    }

}
